package com.probiz.estore.product.service;

import javax.servlet.http.HttpServletRequest;

import com.probiz.estore.common.model.product.ProductReviewAndVoteVO;
import com.probiz.estore.common.model.product.ReviewVote;
import com.probiz.estore.core.service.GenericManager;

/**
 * Manager interface for ReviewVote, responsible for business processing, and communicate between web and persistence layer.
 *
 */
public interface ReviewVoteManager extends GenericManager<ReviewVote> {
	/**
	 * 根据评论id和客户id获得投票情况
	 * @param productReviewId 评论id
	 * @param customerId 客户id 
	 * @return
	 */
	public ReviewVote getByReviewIdAndCustomerId(Integer productReviewId, Integer customerId); 
	
	/**
	 * 检查是否已经投票了
	 * @param productReviewId
	 * @param customerId
	 * @return
	 */
	public boolean isVoteAlready(Integer productReviewId, Integer customerId);
	/**
	 * 进行投票
	 * @param request
	 * @param productReviewId
	 * @param chosen
	 * @return ProductReviewAndVoteVO.result 0 表示未登录 1 表示成功 2 表示重复投票 3 表示不能对自己的评论进行投票
	 */
	public ProductReviewAndVoteVO doVote(HttpServletRequest request,Integer productReviewId, Short chosen);
	
	
}
